using Gateway.Common.SqlSugar;
using SqlSugar;
using System.ComponentModel.DataAnnotations.Schema;

namespace Gateway.IQuery.SystemSetting.Result;

[SugarTable("SystemSetting")]
public class SystemSettingDetailResult : BaseResult
{
    /// <summary>
    /// 系统名称
    /// </summary>
    public string SystemName { get; set; }

    /// <summary>
    /// LogoUrl
    /// </summary>
    public string LogoUrl { get; set; }

    /// <summary>
    /// 登录开关  all 普通用户+管理员用户  user 普通用户 admin 管理员用户
    /// </summary>
    public string LoginType { get; set; }

    [SugarColumn(IsIgnore = true)]
    public bool LoginTypeFormat => (LoginType ?? "").Equals("user") ||(LoginType ?? "").Equals("all") ;
    /// <summary>
    /// 密码验证规则
    /// </summary>
    public string PasswordRegex { get; set; }

    /// <summary>
    /// 版权信息
    /// </summary>
    public string Copyright { get; set; }
    
    /// <summary>
    /// 短信配置
    /// </summary>
   [SugarColumn(IsIgnore = true)]
    public SystemSmsDetailResult Sms { get; set; }

    /// <summary>
    /// 扩展配置
    /// </summary>
    [SugarColumn(IsIgnore = true)] 
    public List<SystemExtensionSettingDetailResult> Extensions { get; set; }

    /// <summary>
    /// ai setting json
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    [NotMapped]
    public string AISetting { get; set; }
}